home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!escan.demon.co.uk
- From: Bill Birrell <bill@escan.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: HELP on string functions ????
- Date: Wed, 06 Mar 1996 22:05:00
- Message-ID: <826150130.AA00176@escan.demon.co.uk>
- Reply-To: bill@escan.demon.co.uk
- X-NNTP-Posting-Host: escan.demon.co.uk
- X-Mail2News-Path: escan.demon.co.uk
-
- > Can anybody tell me if there is similar function in
- > place of "strset()" ?
- > Or is there another way of doing this :
- > I need to reinitialize a char pointer during run-time.
- > The statement
- > char *p; p = ""; is causing me problems. I can't use
- > "strset(p,'\0')"
- > because the compiler on the unix machine doesn't
- > recognise the function.
-
- What's wrong with:-
-
- char *p;
- *p='\0'; ?
-
- alternatively you could write a funtion:-
-
- void strset(char *p, char q)
- {
- *p=q;
- }
-
- Ho-hum!
-
- --
- Regards,
- Bill Birrell.
- internet: bill@escan.demon.co.uk
-